package com.bzchao.doublecamera.utils;

/**
 * 处理时间统计工具
 */
public class TimeStaticUtils {
    private long startTime; //起始时间
    private long endTime; //结束时间
    private long handleTime; //结束时间

    public static TimeStaticUtils start() {
        TimeStaticUtils timeStaticUtils = new TimeStaticUtils();
        timeStaticUtils.startTime = System.currentTimeMillis();
        return timeStaticUtils;
    }

    public void end() {
        this.endTime = System.currentTimeMillis();
        this.handleTime = this.endTime - this.startTime;
        //支持再次使用
        this.startTime = System.currentTimeMillis();

    }

    public long endAndGetRunTime() {
        this.end();
        return handleTime;
    }
}
